<template lang="pug">
.state
  image.w-24.h-24.mb-24(src="@/assets/success.svg" mode="aspectFit")

  button.submit-btn.px-10.py-6.mb-4(v-if="agreementCheck" open-type="getPhoneNumber" @getphonenumber="handleGetPhoneNumber") 手机号快捷登录
  button.submit-btn.px-10.py-6.mb-4(v-else @click="noAgreementHint") 手机号快捷登录

  .flex.items-center.justify-center( @tap='agreementCheck = !agreementCheck' )
    checkbox(color='#B59E6D'  :checked='agreementCheck' class="scale-75 origin-center")
    view.text-sm.text-gray-600
      | 我已阅读并同意
      text.text-focus 《用户协议》
</template>
<script setup>
import { wxlogin ,getPhoneNumber} from '@/api/auth'
const agreementCheck = ref(false)
 

async function handleGetPhoneNumber(ev){
  const creadits = await wxlogin();
  let { phonenumber } = creadits;
    const res =  await getPhoneNumber({
      code:ev.detail.code
    })
    // uni.setStorageSync("user",{
    //   phone:user.phone,
      
    // })
  if(!phonenumber){
  };
 
  uni.reLaunch({
    url:"/pages/user/user"
  })
}
</script>
<style scoped lang="scss">
.state{
  @apply pt-[20vh] w-full flex flex-col items-center
}
</style>